/*     */ package com.jcraft.jzlib;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ final class Adler32
/*     */ {
/*     */   private static final int BASE = 65521;
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   private static final int NMAX = 5552;
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   long adler32(long adler, byte[] buf, int index, int len)
/*     */   {
/*  45 */     if (buf == null) {
/*  46 */       return 1L;
/*     */     }
/*     */     
/*  49 */     long s1 = adler & 0xFFFF;
/*  50 */     long s2 = adler >> 16 & 0xFFFF;
/*     */     
/*     */ 
/*  53 */     while (len > 0) {
/*  54 */       int k = len < 5552 ? len : 5552;
/*  55 */       len -= k;
/*  56 */       while (k >= 16) {
/*  57 */         s1 += (buf[(index++)] & 0xFF);
/*  58 */         s2 += s1;
/*  59 */         s1 += (buf[(index++)] & 0xFF);
/*  60 */         s2 += s1;
/*  61 */         s1 += (buf[(index++)] & 0xFF);
/*  62 */         s2 += s1;
/*  63 */         s1 += (buf[(index++)] & 0xFF);
/*  64 */         s2 += s1;
/*  65 */         s1 += (buf[(index++)] & 0xFF);
/*  66 */         s2 += s1;
/*  67 */         s1 += (buf[(index++)] & 0xFF);
/*  68 */         s2 += s1;
/*  69 */         s1 += (buf[(index++)] & 0xFF);
/*  70 */         s2 += s1;
/*  71 */         s1 += (buf[(index++)] & 0xFF);
/*  72 */         s2 += s1;
/*  73 */         s1 += (buf[(index++)] & 0xFF);
/*  74 */         s2 += s1;
/*  75 */         s1 += (buf[(index++)] & 0xFF);
/*  76 */         s2 += s1;
/*  77 */         s1 += (buf[(index++)] & 0xFF);
/*  78 */         s2 += s1;
/*  79 */         s1 += (buf[(index++)] & 0xFF);
/*  80 */         s2 += s1;
/*  81 */         s1 += (buf[(index++)] & 0xFF);
/*  82 */         s2 += s1;
/*  83 */         s1 += (buf[(index++)] & 0xFF);
/*  84 */         s2 += s1;
/*  85 */         s1 += (buf[(index++)] & 0xFF);
/*  86 */         s2 += s1;
/*  87 */         s1 += (buf[(index++)] & 0xFF);
/*  88 */         s2 += s1;
/*  89 */         k -= 16;
/*     */       }
/*  91 */       if (k != 0) {
/*     */         do {
/*  93 */           s1 += (buf[(index++)] & 0xFF);
/*  94 */           s2 += s1;
/*  95 */           k--; } while (k != 0);
/*     */       }
/*  97 */       s1 %= 65521L;
/*  98 */       s2 %= 65521L;
/*     */     }
/* 100 */     return s2 << 16 | s1;
/*     */   }
/*     */ }


/* Location:              D:\Program Files\DBMS_20150813\jdbc\Dm7JdbcDriver17.jar!\com\jcraft\jzlib\Adler32.class
 * Java compiler version: 2 (46.0)
 * JD-Core Version:       0.7.1
 */